Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2001 10:13:12 -0500
From:      "Portwood, Jason" <JPortwood@strategicit.net>
To:        "'tech@squid.tznet.com'" <tech@squid.tznet.com>, "'freebsd-questions@FreeBSD.ORG'" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Mail Server & Adduser
Message-ID:  <6381A6A8826BD31199500090279CAFBA24F467@exchange.strategicit.net>

next in thread | raw e-mail | index | archive | help


> We have a file of 7-8k users and passwords (format is somewhat of 'user
> pass   more info   more info   etc', however it's one user & password per
> line, easily transforable to a script). We need a way to add a user in a
> single command line. Adduser dosen't cut it and  pw does add a user ina
> single command line, but dosen't include the password. 

I think pw and perl is the answer here.  

There is a user entry program called enteruser
(http://www.de.daemonnews.org/199908/enteruser.html)
and in there it has the magic line to do what I think you want.

open( PW, "| $pw_path useradd $username -c \"$fullname\" -m -s $shell -h 0"
)
or die "$pw_path failure: $!";
print PW $password, "\n";

That will add the account with the password.  

Just some modifications to that program and it should do what you need it
to.  

Hope that helps, it worked for me.

Jason Portwood  (jason@iac.net)
Internet Systems Administrator   
Strategic / Internet Access Cincinnati
Sales & Tech Support 513-860-9052 



 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6381A6A8826BD31199500090279CAFBA24F467>